<?php

/**
 * Project: CrazyPoems
 * Author: Alexandru
 * Date: 23/10/2008
 * File: poems.php
 */

// Load default settings.
require('inc/config.php');
require('inc/functions.misc.php');
require('inc/functions.index.php');
require('inc/functions.member.php');
require('inc/functions.members.php');

// Get parameters.
$search = $_GET['search'];
$breadcrumbs = '<a href="'.BASE_URL.'">'.l('Inicio').'</a>';
$pageTitle = l(Miembros);
$breadcrumbs .=' &raquo; '.l(Miembros).'';

$members = getMembers("", 10, $search);

if (isset($members[0])) {
    $membersTo = "left";
    $leftMembers = array();
    $rightMembers = array();
    for ($i = 0; $i < sizeof($members); $i++) {
        if ($membersTo == "left") {
           $leftMembers[] = $members[$i];
           $membersTo = "right";
        } else {
           $rightMembers[] = $members[$i];
           $membersTo = "left";
        }
    }
}
$smarty->assign('pageTitle', $pageTitle);
$smarty->assign('breadcrumbs', $breadcrumbs);
$smarty->assign('leftMembers', $leftMembers);
$smarty->assign('rightMembers', $rightMembers);
$smarty->assign('search', $search);

$smarty->display('members.tpl');

// End page.
require('inc/end.php');
?>
